package org.springsource.domain;

import java.io.Serializable;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.codehaus.jackson.annotate.JsonIgnore;

@Entity
@Table(name = "Level")
public class Level implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -6964856579837149791L;

	@Id
	@Column(name = "id", nullable = false)
	private Long id;
	
	@JsonIgnore
	@ManyToOne
    @JoinColumn(name="countryCode",insertable=false, updatable=false)
	private Country country;

	@Column(name = "name", nullable = true)
	private String name;

	@Column(name = "value", nullable = true)
	private String value;
	
	@OneToMany(fetch = FetchType.LAZY, cascade = { CascadeType.ALL })
	@JoinColumn(name = "levelId")
	private List<Team> teams;
	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Country getCountry() {
		return country;
	}

	public void setCountry(Country country) {
		this.country = country;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public List<Team> getTeams() {
		return teams;
	}

	public void setTeams(List<Team> teams) {
		this.teams = teams;
	}
}
